#include <stdio.h>
#include <stdlib.h>
struct st
{
	int id;
	int sc;
	struct st* next;
};

struct st* creat()
{
	int n = 0;
	struct st* head, * p1, * p2;
	head = p2 = p1 = (struct st*)malloc(sizeof(struct st));
	printf("input\n");
	scanf_s("%d %d", &p1->id, &p1->sc);
	while (p1->id != 0)
	{
		n += 1;
		if (n == 1) head = p1;
		else p2->next = p1;
		p2 = p1;
		p1 = (struct st*)malloc(sizeof(struct st));
		scanf_s("%d %d", &p1->id, &p1->sc);
	}
	p2->next = NULL;
	return head;
}

int main()
{
	creat();
	return 0;
}